import { $t } from '#/locales';

export const stateComponentProps = (all?: boolean) => {
  return all
    ? {
        options: [
          { label: '所有', value: null },
          { label: $t('common.enable'), value: true },
          { label: $t('common.disable'), value: false },
        ],
      }
    : {
        options: [
          { label: $t('common.enable'), value: true },
          { label: $t('common.disable'), value: false },
        ],
      };
};

export const yesNoComponentProps = (all = false) => {
  return all
    ? {
        options: [
          { label: '所有', value: null },
          { label: $t('common.yes'), value: true },
          { label: $t('common.no'), value: false },
        ],
      }
    : {
        options: [
          { label: $t('common.yes'), value: true },
          { label: $t('common.no'), value: false },
        ],
      };
};

export const stateFilters = () => {
  return [
    { text: $t('common.enable'), value: 'true' },
    { text: $t('common.disable'), value: 'false' },
  ];
};

export const yesNoFilters = () => {
  return [
    { text: $t('common.yes'), value: 'true' },
    { text: $t('common.no'), value: 'false' },
  ];
};
